import Vue from 'vue'
import Router from 'vue-router'
import LoginAndRegister from "../components/login/LoginAndRegister";
import CoursesDisplay from "../components/courses/CoursesDisplay";
import Home from '../components/home/Layout'
import shouye from "../components/home/shouye"
import food from "../components/food/foodanddrink"
import foodtitle from "../components/food/showtitle"
import fooddetail from "../components/food/fooddetail";
import order from "../components/order/order";
import videoupload from "../components/upload/videoupload";
import personalcenter from "../components/personal/personalcenter";
import CourseDetail from "../components/courses/CourseDetail";
import VideoLayout from "../components/video/VideoLayout";
import VideoDetail from "../components/video/VideoDetail";
import VideoContent from "../components/video/VideoContent";
import videorevise from "../components/revise/videorevise";
import Layout from "../components/admin/Layout";
import foodcontroller from "../components/adminfood/foodcontroller";
import details from "../components/adminfood/details";
import revisefood from "../components/adminfood/revisefood";
import revisevideo from "../components/adminvideo/revisevideo";
import videode from "../components/adminvideo/videode";
import coursede from "../components/admincourse/coursede";
import revisecourse from "../components/admincourse/revisecourse";
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/login',
      name: '登录',
      meta: {title: '登录'},
      component: LoginAndRegister
    },
    {
      path: '/',
      name: '登录',
      meta: {title: '登录'},
      component: LoginAndRegister
    },

    {
      path: '/home',
      name: 'Home',
      component: Home,
      redirect: '/shouye',
      children: [
        {
          path: '/shouye',
          name: '首页',
          meta: {title: '首页'},
          component: shouye
        },
        {
          path: '/food',
          name: '饮食',
          meta: {title: '饮食'},
          component: food,
          redirect: '/foodtitle',
          children: [
            {
              path: '/foodtitle',
              name: '食物首页',
              meta: {title: '食物首页'},
              component: foodtitle
            },
            {
              path: '/fooddetail',
              name: '食物详情',
              meta: {title: '食物详情'},
              component: fooddetail
            },
          ]
        },
        {
          path: '/courses',
          name: '课程',
          meta: {title: '课程'},
          component: CoursesDisplay,

        },
        {
          path: '/order',
          name: '订单信息',
          meta: {title: '订单信息'},
          component: order
        },
        {
          path: '/videoupload',
          name: '视频投稿',
          meta: {title: '帖子投稿'},
          component: videoupload
        },
        {
          path: '/personal',
          name: '个人中心',
          meta: {title: '个人中心'},
          component: personalcenter,
          children: []
        },
        {
          path: '/videorevise',
          name: '视频投稿',
          meta: {title: '帖子投稿'},
          component: videorevise
        },
        {
          path: "/courseDetail",
          name: '课程详情',
          meta: {title: "课程详情"},
          component: CourseDetail
        },
        {
          path: "/video",
          name: '视频',
          meta: {title: "视频"},
          component: VideoLayout,
          redirect: '/videoContent',
          children: [
            {
              path: "/videoContent",
              name: "视频内容",
              meta: {title: "视频内容"},
              component: VideoContent
            },
            {
              path: "/videoDetail",
              name: "视频详情",
              meta: {title: "视频详情"},
              component: VideoDetail
            }
          ]
        }

      ],
    },
    {
      path: '/admin',
      name: 'admin',
      component: Layout,
      // redirect: '/shouye',
      children: [
        {
          path: '/foodcontroller',
          name: '饮食管理',
          meta: {title: '饮食管理'},
          component: foodcontroller
        },
        {
          path: '/details',
          name: '饮食',
          meta: {title: '饮食'},
          component: details
        },
        {
          path: '/revisefood',
          name: '修改饮食',
          meta: {title: '修改饮食'},
          component: revisefood
        },
        {
          path: '/videode',
          name: '视频',
          meta: {title: '视频'},
          component:videode
        }, {
          path: '/revisevideo',
          name: '审核视频',
          meta: {title: '审核视频'},
          component: revisevideo
        },
        {
          path: '/coursede',
          name: '课程',
          meta: {title: '课程'},
          component:coursede
        },
        {
          path: '/revisecourse',
          name: '课程',
          meta: {title: '课程'},
          component:revisecourse
        },

      ]
    },
  ]
})
